package com.sita.bike.utils;

import android.text.TextUtils;

/**
 * Class ValidateUtils is for
 *
 * @author xiaodong on 15/3/2.
 */
public class ValidateUtils {
    public static boolean checkMobile(String mobile) {
        return mobile.matches("1[2,3,4,5,6,7,8,9]{1}\\d{9}");
    }

    public static boolean checkPassword(String password) {
        if (TextUtils.isEmpty(password) || password.length() > 20) {
            return false;
        }
        return true;
    }

    public static boolean checkEmail(String email) {
        if (TextUtils.isEmpty(email) || email.length() > 50) {
            return false;
        }
        return email.matches("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
    }

    public static boolean checkName(String name) {
        if (TextUtils.isEmpty(name) || name.length() > 15) {
            return false;
        }
        return true;
    }
}
